package sss;

import java.util.Scanner;

/**
 * @author VernHe
 * @date 2021年08月13日 13:46
 *
 * 5
 * 2 2 3 1 2
 */
public class Day_04_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] boards = new int[n];
        // 接收n个数据
        for (int i = 0; i < n; i++) {
            boards[i] = input.nextInt();
        }
        solution(n, boards);
    }

    private static void solution(int n, int[] boards) {
        int times = 0;
        int result = 0;
        while (result < n) {
            result += boards[result];
            times++;
        }
        System.out.println(times);
    }
}
